#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :1.0.1 百度首页.py
# @Time      :2020/7/16 12:06
# @Author    :亮亮
# @说明       :
# @总结       :
import requests
from fake_useragent import UserAgent
from lxml import etree


def get_html():
    # 1.构建请求头
    url = "http://www.baidu.com"
    headers = {
        "User-Agent": UserAgent().random
    }

    # 2.构建返回对象
    response = requests.get(url, headers=headers)

    # 3.从返回对象中解析出内容
    info = response.text

    return info


def main():
    info = get_html()

    print(info)


if __name__ == '__main__':
    main()
